unit wbSound;

interface
uses Windows, Classes, SysUtils, Forms, MMSystem;

procedure PlaySoundFile(FileName: string; Params: Word = SND_SYNC or SND_MEMORY); //

implementation

procedure PlaySoundFile(FileName: string; Params: Word = SND_SYNC or SND_MEMORY); // or SND_MEMORY
var
	M: TMemoryStream;
begin
	M := TMemoryStream.Create; // create memory stream
	try
		M.LoadFromFile(FileName);
		// Attempt to play sound.  Raise exception if something goes wrong
		//Win32Check(PlaySound(M.Memory, Application.Handle, Params));
		PlaySound(M.Memory, Application.Handle, Params);
	finally
		M.Free;
	end;
end;


end.
